// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the CONSOLEHOST_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// CONSOLEHOST_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef CONSOLEHOST_EXPORTS
#define CONSOLEHOST_API __declspec(dllexport)
#else
#define CONSOLEHOST_API __declspec(dllimport)
#endif

class ConsoleHandler;

class CONSOLEHOST_API ConsoleHost
{
public:
		void SetupDelegates(void (consoleChangedCallback) (bool) , void (consoleCloseDelegate)());
		bool StartShellProcess(LPCTSTR strCustomShell, LPCTSTR strInitialDir, LPCTSTR strConsoleTitle, DWORD dwStartupRows, DWORD dwStartupColumns);

		~ConsoleHost();

		DWORD StartMonitorThread();
		void StopMonitorThread();
		ConsoleParams* GetConsoleParams();

		CHAR_INFO* GetConsoleBuffer();

		CONSOLE_SCREEN_BUFFER_INFO* GetConsoleInfo();

		/*
		SharedMemory<CONSOLE_CURSOR_INFO>& GetCursorInfo()			{ return m_cursorInfo; }
		SharedMemory<UINT_PTR>& GetConsolePasteInfo()				{ return m_consolePaste; }
		SharedMemory<ConsoleSize>& GetNewConsoleSize()				{ return m_newConsoleSize; }
		SharedMemory<SIZE>& GetNewScrollPos()						{ return m_newScrollPos; }
		*/

		void SendTextToConsole(LPCWSTR pszText);

		void SetScrollPosition(int cols, int rows);

		void GetConsoleSize(int* outCols, int* outRows);
		void SetConsoleSize(int cols, int rows);

		ConsoleHandler* _consoleHandler;
};

CONSOLEHOST_API ConsoleHost* CreateConsoleHost();
CONSOLEHOST_API void DeleteConsoleHost(ConsoleHost *target);
